﻿<%@ Page Language="C#" MasterPageFile="~/web.master" AutoEventWireup="true" CodeBehind="rkp_officer_unit.aspx.cs" Inherits="Shuba.Web.master.rkp_officer_unit"%>
<%@ Register Assembly="Shuba.Framework" Namespace="Shuba.Framework" TagPrefix="cc" %>
<asp:Content ID="Header1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">
<script type="text/javascript">
	function PrintThis() {
		var unit_code = document.getElementById('<%= ddlUnit.ClientID %>').value; //document.getElementById("ctl00_ContentPlaceHolder1_ddlunit").value;
		var start_date = document.getElementById('<%= txtStartDate.ClientID %>_foo').value; //document.getElementById("ctl00_ContentPlaceHolder1_txtStartDate_foo").value;
		var end_date = document.getElementById('<%= txtToDate.ClientID %>_foo').value; //document.getElementById("ctl00_ContentPlaceHolder1_txtToDate_foo").value;
		window.open("rkp_officer_unit_excel.aspx?unit_code=" + unit_code + "&start=" + start_date + "&end=" + end_date);
	}
</script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2">
        <tr>
            <td class="text bg_content" bgcolor="#FFFFFF" align="center">
                <p>
                    &nbsp;</p>
                <table class="black" border="0" width="95%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="title_back" align="left">
					    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="0">
					    <tr>
					    <td class="title_back2" width="2%">&nbsp;</td>
					    <td class="title_back2 title_white" width="38%"><asp:Label ID="LabelTitle" runat="server" Text="Label"></asp:Label></td>
					    <td><span class="title_right"></span></td>
					    </tr>
					    </table>
                        </td>
                        <td class="title_back" align="right">&nbsp;</td>
                    </tr>
                    <tr>
                        <td class="border_left bg_subtitle_white">&nbsp;&nbsp;&nbsp;</td>
                        <td class="border_right bg_subtitle" align="right">&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="2">
                        
                        <table width=100% class="black border" border="0" cellspacing="0" cellpadding="2">
                        <tr>
                            <td class="bg_grid" align="right">&nbsp;</td>
                            <td class="bg_grid2" align="left">&nbsp;</td>
                        </tr>
					     <tr>
					        <td class="bg_grid" align="right">REGION</td>
					        <td class="bg_grid2" align="left">
					        <asp:DropDownList ID="ddlRegion" AutoPostBack="true" runat="server" Width="285px" CssClass="text" OnSelectedIndexChanged="ddlRegion_SelectedIndexChanged"></asp:DropDownList>&nbsp;
					        </td>
					     </tr>
					     <tr>
					        <td class="bg_grid" align="right">CLUSTER</td>
					        <td class="bg_grid2" align="left">
                            <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                            <ContentTemplate>
                            <asp:DropDownList ID="ddlCluster" AutoPostBack="true" runat="server" Width="285px" CssClass="text" OnSelectedIndexChanged="ddlCluster_SelectedIndexChanged"></asp:DropDownList>&nbsp;
                            </ContentTemplate>
                            <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="ddlRegion" EventName="SelectedIndexChanged"/>
                            </Triggers>
                            </asp:UpdatePanel>
                            </td>
                          </tr>
					     <tr>
					        <td class="bg_grid" align="right">UNIT</td>
					        <td class="bg_grid2" align="left">
                            <asp:UpdatePanel ID="UpdatePanel4" runat="server">
                            <ContentTemplate>
                            <asp:DropDownList ID="ddlUnit" runat="server" Width="285px" CssClass="text" 
                                    onselectedindexchanged="ddlUnit_SelectedIndexChanged"></asp:DropDownList>&nbsp;
                            </ContentTemplate>
                            <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="ddlCluster" EventName="SelectedIndexChanged"/>
                            </Triggers>
                            </asp:UpdatePanel>
                            </td>
                          </tr>
                        <tr>
						    <td class="bg_grid" align="right" width="18%">PERIOD</td>
						    <td class="bg_grid2" align="left">
						    <cc:DatePicker ID="txtStartDate" imgDirectory="../images/" ControlCssClass="text" CssClass="text" runat="server"></cc:DatePicker>
						    &nbsp;to&nbsp;
						    <cc:DatePicker ID="txtToDate" imgDirectory="../images/" ControlCssClass="text" CssClass="text" runat="server"></cc:DatePicker>
						    </td>
						</tr>						
                        <tr>
                            <td class="bg_grid" align="right">&nbsp;</td>
                            <td class="bg_grid2" align="left">
                            <table border=0 cellpadding=0 cellspacing=0>
                            <tr>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanel5" runat="server">
                                <ContentTemplate>
						            <asp:Button ID="btnSearch" CssClass="buttonsmall" runat="server" Text="Search" OnClick="btnSearch_Click" />&nbsp;
						        </ContentTemplate>
						        <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="ddlUnit" EventName="SelectedIndexChanged"/>
                                </Triggers>
						        </asp:UpdatePanel>
                            </td>
                            <td>
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <asp:Button ID="btnExcel" CssClass="button" runat="server" Text="Export to Excel" OnClick="btnExcel_Click" />&nbsp;&nbsp;
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"/>
                                </Triggers>
                                </asp:UpdatePanel>
                            </td>
                            </tr>
                            </table>
                            </td>
                        </tr>
                        <tr>
                            <td class="bg_grid" align="right">&nbsp;</td>
                            <td class="bg_grid2" align="left">&nbsp;</td>
                        </tr>
                        </table>
                        </td>
                        <tr>
                        <td class="border" colspan=2>
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                            <cc:SHUBAGrid ID="gvList" runat="server" AutoGenerateColumns="False" Width="100%"
                                DataKeyNames="PROSPECT_ID" 
                                AllowPaging="True"  PageSize="20" OnPageIndexChanging="gvList_PageIndexChanging"
                                AllowSorting="True" OnSorting="gvList_Sorting">
                                <Columns>
                                    <asp:BoundField DataField="AO_CODE" HeaderText="SALES OFFICER" SortExpression="AO_CODE" ItemStyle-HorizontalAlign=Center />
                                    <asp:BoundField DataField="OFFICER_NAME" HeaderText="OFFICER NAME" SortExpression="OFFICER_NAME" ItemStyle-HorizontalAlign=Left/>
                                    <asp:BoundField DataField="PROSPECT_NO" HeaderText="PROSPECT REF. NO" SortExpression="PROSPECT_NO" ItemStyle-HorizontalAlign=Center />
                                    <asp:BoundField DataField="FULL_NAME" HeaderText="PROSPECT NAME" SortExpression="FULL_NAME" ItemStyle-HorizontalAlign=Left />
                                    <asp:BoundField DataField="ENTRY_DATE" HeaderText="DATE ENTERED" SortExpression="ENTRY_DATE" DataFormatString="{0:dd MMM yyyy}" ItemStyle-HorizontalAlign=Center />
                                    <asp:BoundField DataField="GU_FUP" HeaderText="GOOD UNTIL WHEN" SortExpression="GU_FUP" DataFormatString="{0:dd MMM yyyy}" ItemStyle-HorizontalAlign=Center />
                                    <asp:BoundField DataField="PRODUCT_TYPE" HeaderText="PRODUCT TYPE" SortExpression="PRODUCT_TYPE" ItemStyle-HorizontalAlign=Left />
                                    <asp:BoundField DataField="DEBTOR_TYPE" HeaderText="TYPE OF DEBTOR" SortExpression="DEBTOR_TYPE" ItemStyle-HorizontalAlign=Left />
                                    <asp:BoundField DataField="PROSPECT_TYPE" HeaderText="CUST. STATUS" SortExpression="PROSPECT_TYPE" ItemStyle-HorizontalAlign=Left />
                                    <asp:BoundField DataField="CYCLE_STATUS" HeaderText="ACTIVITY" SortExpression="CYCLE_STATUS" ItemStyle-HorizontalAlign=Left />
                                    <asp:BoundField DataField="PROGRESS_STATUS" HeaderText="STATUS PROSPECTING" SortExpression="PROGRESS_STATUS" ItemStyle-HorizontalAlign=Left />
                                    <asp:BoundField DataField="CLOSE_DEAL_DATE" HeaderText="DATE CLOSE DEAL" SortExpression="CLOSE_DEAL_DATE" DataFormatString="{0:dd MMM yyyy}" ItemStyle-HorizontalAlign=Center />
                                    <asp:BoundField DataField="NO_OF_VISIT" HeaderText="NO OF VISIT" SortExpression="NO_OF_VISIT" DataFormatString="{0:N0}" ItemStyle-HorizontalAlign=Center />
                                    <asp:BoundField DataField="ACC_NO" HeaderText="ACCOUNT NO" SortExpression="ACC_NO" ItemStyle-HorizontalAlign=Left />
                                    <asp:BoundField DataField="DISBURSE_DATE" HeaderText="DISBURSED DATE" SortExpression="DISBURSE_DATE" DataFormatString="{0:dd MMM yyyy}" ItemStyle-HorizontalAlign=Center />
                                    <asp:BoundField DataField="REJECTED_DATE" HeaderText="APP. REJECTED DATE" SortExpression="REJECTED_DATE" DataFormatString="{0:dd MMM yyyy}" ItemStyle-HorizontalAlign=Center />
                                </Columns>
                                <PagerSettings />
                                <EmptyDataTemplate>
                                    <table class="text" width=100% cellpadding=0 cellspacing=0><tr><td class="bg_grid2" align=center>NO RECORD FOUND</td></tr></table>
                                </EmptyDataTemplate>
                            </cc:SHUBAGrid>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="gvList" EventName="PageIndexChanging"/>
                            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click"/>
                        </Triggers>
                        </asp:UpdatePanel>
                        </td>
                     </tr>
                   </table>
                </td>
            </tr>
        </table>
        
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
    <ProgressTemplate>
    <div class="progressBackgroundFilter"></div>
    <asp:Panel ID="pnlPopup" runat="server" CssClass="progress_popup">
    <div class="container_popup">
        <div class="header_popup">Generating Output, please wait...</div>
        <div class="body_popup">
            <img src="../images/activity.gif" />
        </div>
    </div>
    </asp:Panel>
    </ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>
